home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_actor_glowbug.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  105 lines

  1. # Jones 3D Cog Script
  2. #
  3. # actor_Glowbug.cog
  4. #
  5. # [RT]
  6. #
  7. # Pulses the Glowbug's light.
  8. #
  9. # (C) 1998 LucasArts Entertainment Company LLC. All Rights Reserved
  10. #
  11. # ===================================================================
  12.  
  13. symbols
  14.  
  15.     message        sighted
  16.     message        aievent
  17.     message        removed
  18.     message        killed
  19.     message        pulse
  20.     
  21.     thing        shrimpy                        local
  22.  
  23.     template    glow=lensflarew                local
  24.     template    sparks=bugsparks            local
  25.  
  26.     thing        t_glow                        local
  27.  
  28. end
  29.  
  30. # ===================================================================
  31. code
  32.  
  33. # -------------------------------------------------------------------
  34. sighted:
  35.  
  36.     shrimpy = GetSenderRef();
  37.  
  38.     SetThingUserData(shrimpy, AttachThingToThingMesh(shrimpy, glow, 0));
  39.     SetThingLight(shrimpy, '0.35 0.35 0.55', 1.0, 0.9);
  40.     SetThingPulse(shrimpy, 1.0);
  41.     PlaySoundClass(shrimpy, 1);                        # Play create sound
  42.     
  43.     return;
  44.  
  45.  
  46. # -------------------------------------------------------------------
  47. aievent:
  48.  
  49.     if (BITTEST(GetParam(0), 0x8604))
  50.     {
  51.         ReturnEx(1);
  52.     }
  53.  
  54.     return;
  55.  
  56.  
  57. # -------------------------------------------------------------------
  58. killed:
  59.  
  60.     shrimpy = GetSenderRef();
  61.  
  62.     SetThingPulse(shrimpy, 0.0);
  63.     ClearThingFlags(shrimpy, 0x1);
  64.     DetachThingMesh(GetThingUserData(shrimpy));
  65.     SetThingUserData(shrimpy, -1);
  66.  
  67.     return;
  68.  
  69. # -------------------------------------------------------------------
  70. removed:
  71.  
  72.     shrimpy    = GetSenderRef();
  73.  
  74.     # If theres still a sprite attached, remove it
  75.     if ( GetThingUserData(shrimpy) > -1 )
  76.     {
  77.         DetachThingMesh(GetThingUserData(shrimpy));
  78.     }
  79.  
  80.     return;
  81.  
  82.  
  83. # -------------------------------------------------------------------
  84. pulse:
  85.  
  86.     shrimpy = GetSenderRef();
  87.  
  88.     if (VectorX(GetThingLight(shrimpy)) > 0.1)
  89.     {
  90.         SetThingLight(shrimpy, '0.65 0.65 0.35', 1.0, 0.9);
  91.         AnimateSpriteSize(GetThingUserData(shrimpy), '0.4 0.4 0.4', '0.5 0.5 0.5', 0.5);
  92.     }
  93.     else
  94.     {
  95.         SetThingLight(shrimpy, '0.85 0.85 0.55', 1.0, 0.9);
  96.         AnimateSpriteSize(GetThingUserData(shrimpy), '0.5 0.5 0.5', '0.4 0.4 0.4', 0.5);
  97.     }
  98.  
  99.     CreateThing(sparks, shrimpy);
  100.     
  101.     return;
  102.  
  103. end
  104.  
  105.